﻿@model string
@{
    Layout = "~/Areas/Admin/Views/Shared/_TreeLayout.cshtml";
    ViewBag.Title = "Application Details";
}
@{if (Model != null)
  {
      string url = string.Empty;
      string title = string.Empty;
      Century.Common.Structures.CenturyAdminToken AdminToken = ((Century.Common.Structures.CenturyAdminToken)Session["AdminToken"]);

      string currentPathInAdmin = Century.Business.Repository.PersistData.CurrentSite.Path;
      if (Model == "RegisterLive")
      {
          title = "Live Application Translation";
          url = AdminToken.AccessibleSites[AdminToken.SelectedCountryIndex].LiveApplicationUrl;
      }
      else if (Model == "RegisterLiveThankYou")
      {
          title = "Live Thank You Translation";
          url = string.Format("/{0}/Register/LiveAccount/ThankYou", currentPathInAdmin);
      }
          
      else if (Model == "RegisterDemo")
      {
          title = "Demo Application Translation";
          url = AdminToken.AccessibleSites[AdminToken.SelectedCountryIndex].DemoApplicationUrl;
      }
      else if (Model == "RegisterDemoThankYou")
      {
          title = "Demo Thank You Translation";
          url = string.Format("/{0}/Register/DemoAccount/ThankYou", currentPathInAdmin);
      }
          
      else if (Model == "Sca")
      {
          title = "My Century Application Translation";
          
          url = AdminToken.AccessibleSites[AdminToken.SelectedCountryIndex].LoginUrl;
      }
      string iframeSource = string.Format("{0}?desingmode=false&draftmode=false", url);
    
    <h2>@title</h2>
    
    <text>
        <br/>
        <img src="@Url.Content("~/Content/themes/admin/img/general/warning.png")" alt="Warning" /> Your changes will be appear on <b>Live</b>. There is no draft or etc. version for these properties
        <br />
        <img src="@Url.Content("~/Content/themes/admin/img/general/warning.png")" alt="Warning" /> Please use inline editing for translation, if you can't edit a text please use <b>"Label Translation Menu"</b>
        <br />
        <br />
    </text>

    <div id="tabStrip">
        @{Html.Telerik().TabStrip()
        .Name("SiteDetailTabStrip")
        .Items(tabstrip =>
        {

            tabstrip.Add()
                .Text("Application Preview")
                .ImageUrl(Url.Content("~/Content/themes/admin/img/tabstrip/settings.png"))
                .Content(@<text><iframe id="ifrmDesign" class="ifrmDesign" style="border:10px; height: 100%; min-height: 600px; background: url('/content/themes/admin/img/gifs/loading.gif') center no-repeat;" src='@(iframeSource)' width="100%" height="100%"></iframe></text>);
            @*
            tabstrip.Add()
                .Text("Social Links")
                .ImageUrl(Url.Content("~/Content/themes/admin/img/tabstrip/social_network.png"))
                .Content(@<text>@Html.Action("SocialNetworks", "SiteManagement", new { area = "Admin" })</text>);
            *@
        })
        .SelectedIndex(0)
        .Render();
        }
    </div>
  }
}
